<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>

<Script runat="server" language="VB">
  Public Sub Page_Load(sender As Object, e As EventArgs)
    Dim connection As SqlConnection
    Dim command As SqlCommand
    Dim reader As SqlDataReader
    Dim sqlSelect As String
    Dim strConn = _
	ConfigurationSettings.appSettings("conn")
    sqlSelect="Select * From tblSubCategories"
    sqlSelect +=" where SubCateID>10"    
    connection = New SqlConnection(strConn)
    command = _
	New SqlCommand(sqlSelect, connection)
    connection.Open()
    reader = command.ExecuteReader()
    datagrid1.DataSource = reader
    datagrid1.DataBind()
    connection.Close()
  End Sub
  Sub Page_Error(Sender As Object, E AS EventArgs)
	Dim err As String
	err="Error in: " & Request.Url.ToString() 
	err+="<br />Stack Trace Below:<br />" & _
	Server.GetlastError().toString()
	Response.Write(err)
	Server.ClearError()
  End Sub
</Script>
<asp:datagrid id="datagrid1" runat="server" />
